/**
 * @整数与浮点数之间的转换
 *
 * @author	 wangshikun <wangshikun2010@gmail.com>
 * @copyright	(c) 2012 wangshikun <wangshikun2010@gmail.com>
 * @license	http://www.opensource.org/licenses/mit-license.php The MIT License
 * @package	default
 * @subpackage	default
 */

#include <stdio.h>
#include <cs50.h>

int main(int argc, char *argv[]) {
	float f1 = 123.125, f2;
	int i1, i2 = -150;
	char c = 'a';

	i1 = f1;
	printf("%f转换之后是%i\n", f1, i1);
	f1 = i2;
	printf("%i转换之后是%f\n", i2, f1);
	f1 = i2 / 100;
	printf("%i转换之后是%f\n", i2, f1);
	f2 = i2 / 100.0;
	printf("%i转换之后是%f\n", i2, f2);
	f2 = (float) i2 / 100;
	printf("(float)%i转换之后是%f\n", i2, f2);

	return 0;
}
